<?php
$user = Yii::app()->getSession()->get('LOGGED_USER');
?>
<header class="hd-home container">
    <div class="row-fluid">
        <div class="col-xs-7">
            <div class="row-fluid">
                <div class="logo pull-left">
                    <a href="<?php echo Yii::app()->homeUrl; ?>">
                        <img class="img-responsive"
                             src="<?php echo Yii::app()->baseUrl . '/data/logo/small/' . Yii::app()->params['logo']; ?>"/>
                    </a>
                </div>
                <div class="pull-left slogan-wrapper">
                    <?php if (Yii::app()->session['_lang'] == 'vi') : ?>
                        <?php if (Yii::app()->params['slogan_vi'] != ''): ?>
                            <img class="img-responsive"
                                 src="<?php echo Yii::app()->baseUrl . '/data/logo/' . Yii::app()->params['slogan_vi']; ?>"/>
                        <?php endif; ?>
                    <?php else : ?>
                        <?php if (Yii::app()->params['slogan_en'] != ''): ?>
                            <img class="img-responsive"
                                 src="<?php echo Yii::app()->baseUrl . '/data/logo/' . Yii::app()->params['slogan_en']; ?>"/>
                        <?php endif; ?>
                    <?php endif; ?>

                </div>
            </div>
        </div>
        <div class="col-xs-5 top-head">
            <?php if (Yii::app()->session['_lang'] == 'vi') : ?>
                <ul id="child-nav" style="margin:0;">
                    <li class="search">
                        <div class="search_wrap">
                            <div class="search_inner">
                                <form method="GET" action="<?php echo Yii::app()->createUrl('site/search') ?>">
                                    <input type="text" placeholder="<?php echo Yii::t('lang', 'search'); ?>"
                                           class="text" name="q"/>
                                    <!--                                    <input type="text" placeholder="<?php // echo Yii::t('lang', 'search'); ?>"/>-->
                                    <!--<input type="submit" value="Go" class="btn-search" />-->
                                </form>
                            </div>

                        </div>
                    </li>
                </ul>
                <ul id="child-nav">
                    <form action="" method="post" id="form-lang">
                        <?php if (!isset($user->id)): ?>
                            <?php // if( !isset(Yii::app()->user->id)): ?>
                            <li id="login-content" class="social" rel="en" href="javascript:void();">
                                <a href="<?php echo Yii::app()->createAbsoluteUrl('site/fblogin'); ?>">Log In</a>
                            </li>
                        <?php else: ?>
                            <li class="username dropdown">
                                <img
                                    src="https://graph.facebook.com/<?php echo $user->oauth_uid; ?>/picture?width=25&height=25"/>
                                 <span class="invisible-phone">
                                    <?php echo $user->first_name; ?>
                                        </span>
                              

  <div class="user-dropdown-menu" href="<?php echo Yii::app()->createAbsoluteUrl('site/logout'); ?>">
                                      <p class="caret"></p>
                                        <a href="<?php echo Yii::app()->createAbsoluteUrl('site/logout'); ?>">
                                            Logout</a>
                                      </div>
                            </li>
                            <!-- <li class="social" rel="en" href="javascript:void();">
                                <a class="" href="<?php echo Yii::app()->createAbsoluteUrl('site/logout'); ?>">Logout</a>
                            </li> -->
                        <?php endif; ?>
                        <li class="country select-lang current" rel="vi" href="javascript:void();"><a href="#">VN</a>
                        </li>
                        <li class="country select-lang" rel="en" href="javascript:void();"><a class="" href="">EN</a>
                        </li>

                    </form>
                </ul>
            <?php else : ?>
                <ul id="child-nav" style="margin:0;">
                    <li class="search">
                        <div class="search_wrap">
                            <div class="search_inner">
                                <!--<input type="text" placeholder="<?php echo Yii::t('lang', 'search'); ?>"/>-->
                                <form method="GET" action="<?php echo Yii::app()->createUrl('site/search') ?>">
                                    <input type="text" placeholder="<?php echo Yii::t('lang', 'search'); ?>"
                                           class="text" name="q"/>
                                    <!--                                    <input type="text" placeholder="<?php // echo Yii::t('lang', 'search'); ?>"/>-->
                                    <!--<input type="submit" value="Go" class="btn-search" />-->
                                </form>
                            </div>
                        </div>
                    </li>

                </ul>
                <ul id="child-nav">

                    <form action="" method="post" id="form-lang">
                        <?php if (!isset($user->id)): ?>
                            <li id="login-content" class="social" rel="en" href="javascript:void();">
                                <a class="social" href="<?php echo Yii::app()->createAbsoluteUrl('site/fblogin'); ?>">Log
                                    In</a>
                            </li>
                        <?php else: ?>
                            <li id="login-content" class="username dropdown">
                                <img
                                    src="https://graph.facebook.com/<?php echo $user->oauth_uid; ?>/picture?width=32&height=32"/>

                                <p class="user-dropdown">
                                    <?php echo $user->first_name; ?>
                                    <b class="caret fb-dropdown"></b>
                                </p>


                                <ul class="user-dropdown-menu">
                                    <li class="fb-logout" rel="en" href="javascript:void();">
                                        <a class="" href="<?php echo Yii::app()->createAbsoluteUrl('site/logout'); ?>">Logout</a>
                                    </li>
                                </ul>
                            </li>
                        <?php endif; ?>
                        <li class="country select-lang" rel="vi" href="javascript:void();"><a class="" href="#">VN</a>
                        </li>
                        <li class="country select-lang current" rel="en" href="javascript:void();"><a href="">EN</a>
                        </li>

                    </form>
                </ul>

            <?php endif; ?>
        </div>
    </div>
    <input type="hidden" value="" id="getlogin">
    <section id="sec-menu" class="container">
        <nav class="navbar navbar-default" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle btn-nav" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="height: 100% !important;">

                <ul class="nav navbar-nav menuman ">

                    <?php if (isset($model)): ?>
                        <?php foreach ($model as $value) : ?>
                            <?php if ($value['status'] == 0) : ?>
                                <li>
                                    <a href="<?php echo Yii::app()->createUrl('event/viewcat', array('id' => $value['id'])); ?>">
                                        <?php if ($language == 'vi') : ?>
                                            <span><?php echo $value['vi_name']; ?></span>
                                        <?php else : ?>
                                            <span><?php echo $value['name']; ?></span>
                                        <?php endif; ?>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </nav>
    </section>
</header>

